package com.cskaoyan.mapper;

import com.cskaoyan.bean.pojo.Admin;
import com.cskaoyan.bean.pojo.AdminExample;

import java.util.List;

import org.apache.ibatis.annotations.Param;

public interface AdminMapper {
    long countByExample(AdminExample example);

    int deleteByExample(AdminExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Admin record);

    int insertSelective(Admin record);

    List<Admin> selectByExample(AdminExample example);

    Admin selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);

    //修改deleted字段
    int deleteById(@Param("id") Integer id);

    List<String> selectAdminNameList();

    String selectPasswordByUsername(@Param("username") String username);

    Admin selectInfo(String username);

    String selectRoleNameById(@Param("roleId") Integer roleId);

    List<String> selectPermsByRoleId(@Param("roleId") Integer roleId);

    Integer selectGoodsTotal();

    Integer selectUserTotal();

    Integer selectproductTotal();

    Integer selectorderTotal();

    Integer[] selectRoleIdsByPrincipal(@Param("primaryPrincipal") String primaryPrincipal);

    List<String> selectPermissionsByPrincipal(@Param("roleIds") Integer[] roleIds);

    Integer selectIdByName(@Param("username") String adminName);
}